package com.hgq.tencommon.common;

public class R {

    private String code;
    private String msg;
    private Object data;

    public static R ok () {
        return new R("200", "成功");
    }
    //有可能公司状态码不是200
    public static R ok (Object data) {
        return new R("200", "成功", data);
    }
    public static R ok (String code,String msg) {
        return new R(code, msg);
    }
    public static R ok (String code,String msg, Object data) {
        return new R(code, msg, data);
    }
    public static R fail () {
        return new R("500", "失败");
    }
    public static R fail (String code, String msg) {
        return new R(code, msg);
    }
    public R() {
    }

    public R(String code, String msg) {
        this.code = code;
        this.msg = msg;

    }
    public R(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
